package spring.cloud.tasks.server.util;

import com.alibaba.fastjson.JSONObject;
import spring.cloud.tasks.common.TaskItemDefinition;

import java.util.List;

public class TaskItemDatas {
    //gson {{index:1,taskItemString:{type=1,kind=1}},{}}
    public static String[] splitTaskItem(String string) {


        List<TaskItemDefinition> taskItemDataList = JSONObject.parseArray(string, TaskItemDefinition.class);


        String[] ss = new String[taskItemDataList.size()];
        for (int i = 0; i < taskItemDataList.size(); i++) {

            ss[i] = taskItemDataList.get(i).getTaskItemString();

        }
        return ss;

    }
}
